home *** CD-ROM | disk | FTP | other *** search
/ WH Questions 1 / WebberInteractiveWHQ&ALevel1.iso / Xtras / PrintOMatic Lite MX (Win32) / -PrintOMatic Lite MX Demo.dir / 00019_Field_19.txt < prev    next >
Text File  |  2004-04-06  |  2KB  |  58 lines

  1. Setting Text Attributes
  2.  
  3. The following routines are used to set the default text and graphic attributes of a document. These attributes determine the color, font, etc. of subsequently added document elements:
  4.  
  5.     setTextFont    Sets the default text font for non-styled text data
  6.     setTextSize    Sets the default text size for non-styled text data
  7.     setTextStyle    Sets the default text style for non-styled text data
  8.  
  9. setTextFont
  10.  
  11. Syntax:    setTextFont document, fontName
  12.  
  13. Returns: TRUE if the requested font was available
  14.         FALSE if the requested font could not be found
  15.  
  16. This command sets the text font that will be applied to non-styled text data (such as strings) that are subsequently appended to the document object. If the requested font is not available, the default font (Geneva on the Macintosh, Arial on Windows) is used.
  17.  
  18. Note that the current font set using setTextFont will be overridden by the fonts, sizes and styles within styled text field cast members that you subsequently append to your document. The default font used for non-styled text data after appending a styled text field will be the last font contained within the text field.
  19.  
  20. setTextSize
  21.  
  22. Syntax:    setTextSize document, fontSize
  23.  
  24. This command sets the text size that will be applied to non-styled text data (such as strings) that are subsequently appended to the document object.
  25.  
  26. setTextStyle
  27.  
  28. Syntax:    setTextStyle document, styleString
  29.  
  30. This command sets the text style that will be applied to non-styled text data (such as strings) that are subsequently appended to the document object. The values for textStyle correspond exactly to the Director "textStyle" property. Possible values for text styles are:
  31.  
  32.     normal
  33.     plain
  34.     bold
  35.     italic
  36.     underline
  37.  
  38. On the Macintosh, the following additional styles are available:
  39.  
  40.     outline
  41.     condense
  42.     extend
  43.     shadow
  44.  
  45. All values except normal or plain are added together in a call to setTextStyle, so you can combine a number of styles together in a single call.
  46.  
  47.  Example:
  48.  
  49. The following example creates a PrintOMatic document, sets the default font to bold italicized 10 point Helvetica, and prints a short text string:
  50.  
  51.     set doc = new(xtra "PrintOMatic")
  52.     if not objectP(doc) then exit
  53.     setTextStyle doc, "bold, italic"
  54.     setTextFont doc, "Helvetica"
  55.     setTextSize doc, 10
  56.     append doc, "Some sample text to print out."
  57.     if doJobSetup(doc) then print doc
  58.     set doc = 0